/*
 * @Author: 霍雷
 * @Date: 2022-05-23 14:50:32
 * @LastEditors: Oscar Young
 * @LastEditTime: 2023-02-24 14:12:45
 * @FilePath: /gua-dev-starter/src/main.ts
 * @Discription:
 */
import { createApp } from 'vue'
import { setupRouter } from '@/router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { createPinia} from "pinia";
import 'virtual:svg-icons-register'
import i18n from './locales/i18n.js'
import App from './App.vue'
import SvgIcon from '@/components/svg-icon.vue'
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import '@/common/ xhr-interceptor';
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import "./assets/font/font.css"


// import VConsole from 'vconsole';
 
// const vConsole = new VConsole();

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
	app.component(key, component)
  }

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

app.use(ElementPlus)
app.use(i18n)
app.use(pinia)
app.component('SvgIcon', SvgIcon)
async function setupApp() {
	// 挂载路由
	await setupRouter(app)
	app.mount('#app')
}

setupApp()
